using System;

namespace Grapher
{
    public abstract class Chart
    {
        protected string googleChartsBaseUrl;
        private readonly AddOns addOns;

        protected Chart(AddOn chartType)
        {
            addOns = new AddOns(chartType);
            googleChartsBaseUrl = "http://chart.apis.google.com/chart?";
        }

        public Uri Url
        {
            get { return new Uri(googleChartsBaseUrl + addOns.Urify()); }
        }

        public int AddOnsCount
        {
            get { return addOns.Count; }
        }

        public ChartType Type
        {
            get { return addOns.FindChartType(); }
        }

        public void Add(AddOn addOn)
        {
            addOns.AddAfterChecking(addOn);
        }
    }
}